﻿<Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:VMDS_GUIClient_ViewModels_Management_VMs="clr-namespace:VMDS.GUIClient.ViewModels.Management.VMs" xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" x:Class="VMDS.GUIClient.Views.Management.VMs.AddVmStep2" 
      mc:Ignorable="d" 
      d:DesignHeight="454.5" d:DesignWidth="600"
	Title="AddVmStep2">
	<Page.Resources>
		<ResourceDictionary>
			<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF31D22C"/>
			<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
				<Setter Property="Background" Value="Transparent"/>
				<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
				<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
				<Setter Property="Padding" Value="2,0,0,0"/>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type ListBoxItem}">
							<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
								<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
							</Border>
							<ControlTemplate.Triggers>
								<Trigger Property="IsSelected" Value="true">
									<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
									<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
								</Trigger>
								<Trigger Property="IsEnabled" Value="false">
									<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
								</Trigger>
							</ControlTemplate.Triggers>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>
			<DataTemplate x:Key="ScreenShotTemplate2">
				<DataTemplate.Resources>
					<Storyboard x:Key="OnMouseEnter1">
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="grid">
							<EasingDoubleKeyFrame KeyTime="0" Value="160">
								<EasingDoubleKeyFrame.EasingFunction>
									<ElasticEase EasingMode="EaseIn" Oscillations="2"/>
								</EasingDoubleKeyFrame.EasingFunction>
							</EasingDoubleKeyFrame>
							<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="240">
								<EasingDoubleKeyFrame.EasingFunction>
									<BackEase EasingMode="EaseOut"/>
								</EasingDoubleKeyFrame.EasingFunction>
							</EasingDoubleKeyFrame>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
					<Storyboard x:Key="OnMouseLeave1">
						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="grid">
							<EasingDoubleKeyFrame KeyTime="0" Value="240"/>
							<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="160"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</DataTemplate.Resources>
				<Grid x:Name="grid" Margin="0" Height="120" d:DesignWidth="400" Width="Auto" RenderTransformOrigin="0.5,0.5">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="0.033*"/>
						<ColumnDefinition Width="0.925*"/>
						<ColumnDefinition Width="0.042*"/>
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="0,9*"/>
						<RowDefinition Height="0,1*"/>
					</Grid.RowDefinitions>
					<Grid.RenderTransform>
						<TransformGroup>
							<ScaleTransform/>
							<SkewTransform/>
							<RotateTransform/>
							<TranslateTransform/>
						</TransformGroup>
					</Grid.RenderTransform>
					<Image x:Name="image" Margin="0,16,0,8" Source="{Binding FileName}" RenderTransformOrigin="0.5,0.5" Grid.Column="1" Stretch="Uniform">
						<Image.RenderTransform>
							<TransformGroup>
								<ScaleTransform/>
								<SkewTransform/>
								<RotateTransform/>
								<TranslateTransform/>
							</TransformGroup>
						</Image.RenderTransform>
					</Image>
				</Grid>
			</DataTemplate>			
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/VMDS.GUIClient;component/Views/ResourceDictionary1.xaml"/>
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
		 
   
	</Page.Resources>

	<Page.DataContext>
		<VMDS_GUIClient_ViewModels_Management_VMs:AddVmViewModel/>
	</Page.DataContext>

    <Grid>
    	<Image Margin="0" Source="/VMDS.GUIClient;component/Views/Images/snapshot.png" Opacity="0.45"/>
    	<Rectangle Margin="5" Stroke="#FFF8F3F3" StrokeThickness="0.5" RadiusX="10" RadiusY="10">
    		<Rectangle.Fill>
    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.435">
    				<LinearGradientBrush.RelativeTransform>
    					<TransformGroup>
    						<ScaleTransform CenterY="0.5" CenterX="0.5"/>
    						<SkewTransform CenterY="0.5" CenterX="0.5"/>
    						<RotateTransform CenterY="0.5" CenterX="0.5"/>
    						<TranslateTransform/>
    					</TransformGroup>
    				</LinearGradientBrush.RelativeTransform>
    				<GradientStop Color="#FFEFECEC"/>
    				<GradientStop Offset="0.558"/>
    				<GradientStop Color="#FFEFECEC" Offset="1"/>
    				<GradientStop Offset="0.494"/>
    			</LinearGradientBrush>
    		</Rectangle.Fill>
    	</Rectangle>
    	<Button Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,40,22.5" Grid.Row="0" Style="{DynamicResource Button}" VerticalAlignment="Bottom" Width="103" d:LayoutOverrides="Height" Command="{Binding Instance.GoToStep3, Mode=OneWay}">
    		<StackPanel Orientation="Horizontal">
    			<TextBlock Height="24" Margin="0,0,7,0" TextWrapping="Wrap" Text="Далее" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18.667"/>
    			<ed:BlockArrow Height="24" Margin="0" Orientation="Right" Stroke="#FFF8F3F3" StrokeThickness="0.5" Width="32" VerticalAlignment="Center">
    				<ed:BlockArrow.Fill>
    					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    						<GradientStop Color="#FF09991F" Offset="0.51"/>
    						<GradientStop Offset="1"/>
    						<GradientStop/>
    					</LinearGradientBrush>
    				</ed:BlockArrow.Fill>
    			</ed:BlockArrow>
    		</StackPanel>
    	</Button>
    	<TextBlock Margin="225,0,225,22.5" TextWrapping="Wrap" Text="Шаг 2/3" Height="32" VerticalAlignment="Bottom" TextAlignment="Center" FontSize="18.667"/>
    	<Button Grid.Column="0" HorizontalAlignment="Left" Margin="40,0,0,22.5" Grid.Row="0" Style="{DynamicResource Button}" VerticalAlignment="Bottom" Width="103" d:LayoutOverrides="Height" Command="{Binding GoToStep1, Mode=OneWay}">
    		<StackPanel Orientation="Horizontal">
    			<ed:BlockArrow Height="24" Margin="0" Orientation="Left" Stroke="#FFF8F3F3" StrokeThickness="0.5" Width="32" VerticalAlignment="Center">
    				<ed:BlockArrow.Fill>
    					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    						<GradientStop Color="#FF09991F" Offset="0.51"/>
    						<GradientStop Offset="1"/>
    						<GradientStop/>
    					</LinearGradientBrush>
    				</ed:BlockArrow.Fill>
    			</ed:BlockArrow>
    			<TextBlock Height="24" Margin="7,0,0,0" TextWrapping="Wrap" Text="Назад" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18.667"/>
    		</StackPanel>
    	</Button>
    	<TextBlock Margin="75.243,34,0,0" TextWrapping="Wrap" Height="32" VerticalAlignment="Top" TextAlignment="Center" FontSize="21.333" HorizontalAlignment="Left"><Run Language="ru-ru" Text="Снимки экрана"/></TextBlock>
    	<ListBox  ItemTemplate="{DynamicResource ScreenShotTemplate2}" Height="131" VerticalAlignment="Top" ItemsSource="{Binding Instance.ScreenShots}" ItemContainerStyle="{DynamicResource ListBoxItemStyle1}" Background="{x:Null}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" HorizontalAlignment="Left" Width="200" d:LayoutOverrides="HorizontalAlignment" Margin="49,196,0,0" SelectedItem="{Binding Instance.CurrentScreen}">
    		<ListBox.BorderBrush>
    			<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}"/>
    		</ListBox.BorderBrush>
    	</ListBox>
    	<GroupBox Header="Добавить" Margin="49,82,0,0" Height="96" VerticalAlignment="Top" HorizontalAlignment="Left" Width="200">
    		<Grid Margin="8,8,0,0" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="224">
    			<Button x:Name="BrowseButton" Content="..." HorizontalAlignment="Right" Margin="0,0,54,0" Click="BrowseButton_Click" FontSize="13.333" FontWeight="Bold" RenderTransformOrigin="2.425,0.293" Width="32.84"/>
    			<TextBox x:Name="PathBox" TextWrapping="Wrap" Text="{Binding Instance.ScreenPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Width="128"/>
    			<Button Content="Добавить" Margin="104,0,54,-39.04" Height="24" VerticalAlignment="Bottom" RenderTransformOrigin="0.273,0.793" Command="{Binding Instance.AddScreen, Mode=OneWay}"/>
    		</Grid>
    	</GroupBox>
    	<Button Content="Удалить" HorizontalAlignment="Right" Margin="0,348,376,0" Width="64" Command="{Binding Instance.DeleteCurrentScr, Mode=OneWay}" Height="24" VerticalAlignment="Top"/>
    	<TextBlock Margin="0,34,88,0" TextWrapping="Wrap" Height="32" VerticalAlignment="Top" TextAlignment="Center" FontSize="21.333" HorizontalAlignment="Right"><Run Language="ru-ru" Text="Логотип"/></TextBlock>
    	<GroupBox Header="Добавить" Margin="0,82,23,0" Height="67" VerticalAlignment="Top" HorizontalAlignment="Right" Width="200">
    		<Grid Margin="8,8,0,0" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="224">
    			<Button x:Name="BrowseButton1" Content="..." HorizontalAlignment="Right" Margin="0,0,54,0" FontSize="13.333" FontWeight="Bold" RenderTransformOrigin="2.425,0.293" Width="32.84" Click="BrowseButton1_Click"/>
    			<TextBox x:Name="LogoBox" TextWrapping="Wrap" Text="{Binding Instance.Logo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Width="128"/>
    		</Grid>
    	</GroupBox>
    	<Image HorizontalAlignment="Right" Margin="0,162,23,161.5" Width="200" Source="{Binding Instance.Logo}"/>
    </Grid>
</Page>
